<template>
  <div>登录页</div>
</template>

<script>
import { mapMutations } from 'vuex'
export default {
   name: 'Login',
   data() {
    //  const enum = {
    //    1:
    //  }
    return {}
   },
   created(){
     this.$API.GET_USER({role:1}).then(res => {
       if(res.role === 1) {
         this.setTitle('我的任务')
       } else if(res.role === 2) {
         this.setTitle('任务概况')
       }
       this.setRole(res.role)
     })
   },
   methods: {
     ...mapMutations(['setRole', 'setTitle'])
   }
}
</script>